-
Notifications
You must be signed in to change notification settings - Fork 36
Allow to create a pool with NULL params #1409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
d14149a
to
45c78ee
Compare
45c78ee
to
675f786
Compare
eba9ea7
to
2c04d26
Compare
fc88217
to
40739be
Compare
40d794c
to
5c028ae
Compare
5c028ae
to
e9d89b6
Compare
src/pool/pool_jemalloc.c
Outdated
int n_arenas_set_from_params = 0; | ||
int err; | ||
const umf_jemalloc_pool_params_t *jemalloc_params = params; | ||
const umf_jemalloc_pool_params_t *jemalloc_params; | ||
|
||
size_t n_arenas = 0; | ||
if (jemalloc_params) { | ||
n_arenas = jemalloc_params->n_arenas; | ||
n_arenas_set_from_params = 1; | ||
// If params is NULL, use default values | ||
umf_jemalloc_pool_params_t default_params = {}; // Will be calculated later | ||
|
||
if (!params) { | ||
jemalloc_params = &default_params; | ||
} else { | ||
jemalloc_params = params; | ||
} | ||
size_t n_arenas = jemalloc_params->n_arenas; | ||
int n_arenas_set_from_params = (params != NULL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why what? please be more specific in reviews! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this is very specific question which i asked - why did you made this changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the original implementation, there was a variable definition that would later change. Here is a definition that relies on the value provided by the user (NULL
or not) and set proper value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted
3dc3f45
to
2e22aa4
Compare
Description
Checklist